package base.bean;

import javax.persistence.*;

/**
 * Created by 30509 on 2018/3/18.
 */
@Entity
@Table(name = "room", schema = "hotel")
public class RoomEntity {
    private int id;
    private Integer roomid;
    private String roomtype;
    private String floor;
    private String price;
    private int clps;
    private int cips;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "roomid")
    public Integer getRoomid() {
        return roomid;
    }

    public void setRoomid(Integer roomid) {
        this.roomid = roomid;
    }

    @Basic
    @Column(name = "roomtype")
    public String getRoomtype() {
        return roomtype;
    }

    public void setRoomtype(String roomtype) {
        this.roomtype = roomtype;
    }

    @Basic
    @Column(name = "floor")
    public String getFloor() {
        return floor;
    }

    public void setFloor(String floor) {
        this.floor = floor;
    }

    @Basic
    @Column(name = "price")
    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    @Basic
    @Column(name = "clps")
    public int getClps() {
        return clps;
    }

    public void setClps(int clps) {
        this.clps = clps;
    }

    @Basic
    @Column(name = "cips")
    public int getCips() {
        return cips;
    }

    public void setCips(int cips) {
        this.cips = cips;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RoomEntity that = (RoomEntity) o;

        if (id != that.id) return false;
        if (clps != that.clps) return false;
        if (cips != that.cips) return false;
        if (roomid != null ? !roomid.equals(that.roomid) : that.roomid != null) return false;
        if (roomtype != null ? !roomtype.equals(that.roomtype) : that.roomtype != null) return false;
        if (floor != null ? !floor.equals(that.floor) : that.floor != null) return false;
        if (price != null ? !price.equals(that.price) : that.price != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (roomid != null ? roomid.hashCode() : 0);
        result = 31 * result + (roomtype != null ? roomtype.hashCode() : 0);
        result = 31 * result + (floor != null ? floor.hashCode() : 0);
        result = 31 * result + (price != null ? price.hashCode() : 0);
        result = 31 * result + clps;
        result = 31 * result + cips;
        return result;
    }
}
